//
//  PayJumpListCell.m
//  CenturyCity
//
//  Created by beisheng03 on 2018/1/22.
//  Copyright © 2018年 beisheng. All rights reserved.
//

#import "PayJumpListCell.h"

@interface  PayJumpListCell ()
@property (weak, nonatomic) IBOutlet UILabel *leftLabel;
@property (weak, nonatomic) IBOutlet UILabel *rightLabel;
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *bottomMargin;

@end

@implementation PayJumpListCell

- (void)awakeFromNib {
    
    [super awakeFromNib];
    
    self.bottomMargin.constant = 0;
    
    self.leftLabel.textColor = darkGray;
    
    self.leftLabel.font = MYFONT(15);
    
    self.rightLabel.font = MYFONT(15);
    
}


- (void)setModel:(PayJumpDateModel *)model{
    
    _model = model;
    
    if ([_model.type isEqualToString:@"0"]) {
        
        if (self.index.row == 0) {
            
            self.leftLabel.text = @"订单号";
            self.rightLabel.text = _model.order_no;
            
        } else  if (self.index.row == 1) {
            
            self.leftLabel.text = @"供应商";
            self.rightLabel.text = _model.carrier_operator;
            
        }else  if (self.index.row == 2) {
            
            self.leftLabel.text = @"充值号码";
            self.rightLabel.text = _model.receiver_mobile;
            
        }else  if (self.index.row == 3) {
            
            self.leftLabel.text = @"面值";
            self.rightLabel.text = _model.face_value;
            
        }else  if (self.index.row == 4) {
            
            self.leftLabel.text = @"优惠价";
            self.rightLabel.text = _model.pay_money;
            
        }else{
            
            self.leftLabel.text = @"支付金额";
            self.rightLabel.text = [NSString stringWithFormat:@"¥%@",_model.pay_rmb];
            
            
        }
    } else if ([_model.type isEqualToString:@"1"]){
        
        if (self.index.row == 0) {
            
            self.leftLabel.text = @"订单号";
            self.rightLabel.text = _model.order_no;
            
        } else  if (self.index.row == 1) {
            
            self.leftLabel.text = @"户号";
            self.rightLabel.text = _model.account_number;
            
        }else  if (self.index.row == 2) {
            
            self.leftLabel.text = @"账单号";
            self.rightLabel.text = _model.bill_num;
            
        }else  if (self.index.row == 3) {
            
            self.leftLabel.text = @"截止日期";
            self.rightLabel.text = _model.stoptime;
            
        }else  if (self.index.row == 4) {
            
            self.leftLabel.text = @"缴费金额";
            self.rightLabel.text = _model.pay_money;
            
        }else{
            
            self.leftLabel.text = @"支付金额";
            self.rightLabel.text = [NSString stringWithFormat:@"¥%@",_model.pay_rmb];
            
        }
        
    }else{
        
        if (self.index.row == 0) {
            
            self.leftLabel.text = @"订单号";
            self.rightLabel.text = _model.order_no;
            
        } else  if (self.index.row == 1) {
            
            self.leftLabel.text = @"户号";
            self.rightLabel.text = _model.account_number;
            
        }else  if (self.index.row == 2) {
            
            self.leftLabel.text = @"账单号";
            self.rightLabel.text = _model.bill_num;
            
        }else  if (self.index.row == 3) {
            
            self.leftLabel.text = @"供应商";
            self.rightLabel.text = _model.supplier_name;
            
        }else  if (self.index.row == 4) {
            
            self.leftLabel.text = @"缴费金额";
            self.rightLabel.text = _model.pay_money;
            
        }else{
            
            self.leftLabel.text = @"支付金额";
            self.rightLabel.text = [NSString stringWithFormat:@"¥%@",_model.pay_rmb];
            
        }
        
    }
    
   
    if ([self.leftLabel.text isEqualToString:@"支付金额"]  || [self.leftLabel.text isEqualToString:@"缴费金额"]  || [self.leftLabel.text isEqualToString:@"优惠价"]) {
        
        self.rightLabel.textColor = [UIColor redColor];
        
    }else{
        
        self.rightLabel.textColor = [UIColor blackColor];
        
    }
    
//    0710 2695858
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

}

@end
